package com.gjintel.business.proj.service.impl;

import java.util.List;

import com.gjintel.business.proj.model.ComposeIdPK;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gjintel.business.proj.dao.IDepositReturnDao;
import com.gjintel.business.proj.model.DepositReturn;
import com.gjintel.business.proj.service.IDepositReturnService;
import com.gjintel.sdk.base.dao.Page;
import com.gjintel.sdk.base.service.impl.BaseServiceImpl;

@Service
public class DepositReturnServiceImpl extends BaseServiceImpl  implements IDepositReturnService {

	@Autowired
	private IDepositReturnDao depositReturnDao;
	
	@Override
	public DepositReturn getDepositReturnByProjIdAndCompanyName(String projId, String companyName) {
		return depositReturnDao.getDepositReturnByProjIdAndCompanyName(projId,companyName);
	}

	@Override
	public List<DepositReturn> getDepositReturnList(String projectId) {
		
		return depositReturnDao.getDepositReturnList(projectId);
	}

	@Override
	public DepositReturn getDepositReturn(String bidderName,String projectId) {
		
		return depositReturnDao.getDepositReturn(bidderName,projectId);
	}

	@Override
	public List<DepositReturn> getUnOptList(String projectId,int depositType) {
		
		return depositReturnDao.getUnOptList(projectId,depositType);
	}

	@Override
	public List<DepositReturn> getReturnList(String projectId,int depositType) {
		
		return depositReturnDao.getReturnList(projectId,depositType);
	}
	
	@Override
	public List<DepositReturn> getExcuteDeposit(String projectId, String winningId, Integer depositType) {
		
		return depositReturnDao.getExcuteDeposit(projectId,winningId,depositType);
	}


	@Override
	public List<DepositReturn> getExcuteDepositList(String projectId, Integer depositType,Page page) {
		
		return depositReturnDao.getExcuteDepositList(projectId,depositType,page);
	}

	@Override
	public DepositReturn getExcuteDeposit(String projectId, Integer depositType) {

		return depositReturnDao.getExcuteDeposit(projectId,depositType);
	}


	@Override
	public DepositReturn getDepositListByHstSeqNum(String HstSeqNum) {
		return depositReturnDao.getDepositListByHstSeqNum(HstSeqNum);
	}

	@Override
	public DepositReturn updateDepositReturnPK(DepositReturn dr,ComposeIdPK composeIdPK) {
		    DepositReturn drCopy= new DepositReturn();
           //1.替换新的Pk,生成新对象
		    drCopy.setPk(composeIdPK);
		    drCopy.setAddWord(dr.getAddWord());
		    drCopy.setBankName(dr.getBankName());
		    drCopy.setBankNo(dr.getBankNo());
		    drCopy.setBiaoDuanNo(dr.getBiaoDuanNo());
		    drCopy.setBidderId(dr.getBidderId());
		    drCopy.setDepositTypeExport(dr.getDepositTypeExport());
		    drCopy.setInAcct(dr.getInAcct());
		    drCopy.setIsBid(dr.getIsBid());
		    drCopy.setOutAmount(dr.getOutAmount());
		    drCopy.setProjectCode(dr.getProjectCode());
		    drCopy.setProjectName(dr.getProjectName());
		    drCopy.setProjectType(dr.getProjectType());
		    drCopy.setReturnOpt(dr.getReturnOpt());
		    drCopy.setReturnTime(dr.getReturnTime());
		    drCopy.setStatus(dr.getStatus());
		    drCopy.setTnAmount(dr.getTnAmount());
		    drCopy.setTransTime(dr.getTransTime());
		    drCopy.setUpdateTime(dr.getUpdateTime());
		   //删除删除现有的保证金对象
		    this.remove(dr);

		    return drCopy;
	}
	
}
